import { BikkieRuntime } from "@/shared/bikkie/active";
import { BikkieIds } from "@/shared/bikkie/ids";
import type { Biscuit } from "@/shared/bikkie/schema/attributes";

export function prepareBikkieForTest() {
  BikkieRuntime.get().registerBiscuits(
    new Map([
      [
        BikkieIds.bling,
        {
          craftingCategory: "Currency",
          displayName: "Bling",
          isDroppable: true,
          galoisPath: "items/zeal",
          id: 1534621126189715,
          isCurrency: true,
          name: "bling",
          stackable: 1000000000n,
        } as any, // We should be a Biscuit, but avoid dep for tests.
      ],
      [
        BikkieIds.stone,
        {
          id: 7539420629350510,
          name: "stone",
          stackable: 99n,
          isDroppable: true,
          displayName: "Stone",
          galoisPath: "blocks/stone",
          craftingCategory: "Blocks",
          action: "place",
          tooltipTypeName: "Stone",
          seedDrop: [
            [7, []],
            [3, [[1534621126189715, 1]]],
          ],
          hardnessClass: 3,
          terrainName: "stone",
          preferredDestroyerClass: 2,
          drop: [[1, [[1534621126189850, 1]]]],
          preferredDrop: [[1, [[7539420629350510, 1]]]],
          isBlock: true,
          isAnyStone: true,
          typeOnLeaderboard: "block",
        },
      ],
      [
        BikkieIds.bedrock,
        {
          id: 1534621126189847,
          name: "bedrock",
          stackable: 99n,
          isDroppable: true,
          displayName: "Bedrock",
          galoisPath: "blocks/bedrock",
          craftingCategory: "Blocks",
          action: "place",
          tooltipTypeName: "Stone",
          hardnessClass: -1,
          terrainName: "bedrock",
          preferredDestroyerClass: 2,
          isBlock: true,
          isAnyStone: true,
          typeOnLeaderboard: "block",
        },
      ],
      [
        BikkieIds.dirt,
        {
          id: 4537020877770180,
          name: "dirt",
          stackable: 99n,
          isDroppable: true,
          displayName: "Dirt",
          galoisPath: "blocks/dirt",
          craftingCategory: "Blocks",
          action: "place",
          tooltipTypeName: "Soil",
          seedDrop: [
            [9, []],
            [1, [[1534621126189715, 1]]],
          ],
          hardnessClass: 1,
          terrainName: "dirt",
          preferredDestroyerClass: 2,
          drop: [[1, [[4537020877770180, 1]]]],
          isBlock: true,
          typeOnLeaderboard: "block",
        },
      ],
      [
        BikkieIds.cobblestone,
        {
          id: 1534621126189850,
          name: "cobblestone",
          stackable: 99n,
          isDroppable: true,
          displayName: "Cobblestone",
          galoisPath: "blocks/cobblestone",
          craftingCategory: "Blocks",
          action: "place",
          tooltipTypeName: "Stone",
          seedDrop: [
            [9, []],
            [1, [[1534621126189715, 1]]],
          ],
          hardnessClass: 3,
          terrainName: "cobblestone",
          preferredDestroyerClass: 2,
          drop: [[1, [[1534621126189850, 1]]]],
          preferredDrop: [[1, [[1534621126189850, 1]]]],
          isBlock: true,
          isAnyStone: true,
          typeOnLeaderboard: "block",
        },
      ],
      [
        BikkieIds.grass,
        {
          id: 3588133005856146,
          name: "grass",
          stackable: 99n,
          isDroppable: true,
          displayName: "Grass",
          galoisPath: "blocks/grass",
          craftingCategory: "Block",
          action: "place",
          tooltipTypeName: "Plant",
          seedDrop: [
            [9, []],
            [1, [[1534621126189715, 1]]],
          ],
          hardnessClass: 1,
          terrainName: "grass",
          preferredDestroyerClass: 2,
          drop: [[1, [[3588133005856146, 1]]]],
          isBlock: true,
          typeOnLeaderboard: "block",
        },
      ],
      [
        BikkieIds.oakLog,
        {
          id: 4537020877770174,
          name: "oakLog",
          stackable: 99n,
          isDroppable: true,
          displayName: "Oak Log",
          galoisPath: "blocks/oak_log",
          craftingCategory: "Blocks",
          action: "place",
          tooltipTypeName: "Wood",
          seedDrop: [
            [8, []],
            [2, [[1534621126189715, 1]]],
          ],
          hardnessClass: 2,
          terrainName: "oak_log",
          preferredDestroyerClass: 1,
          drop: [[1, [[4537020877770174, 1]]]],
          isBlock: true,
          burnable: true,
          isLog: true,
          typeOnLeaderboard: "block",
        },
      ],
      [
        BikkieIds.anyStone,
        {
          id: 7539420629350051,
          name: "anyStone",
          stackable: 99n,
          isDroppable: true,
          displayName: "Any Stone",
          galoisPath: "blocks/stone",
          craftingCategory: "Block",
          action: "place",
          tooltipTypeName: "Stone",
          seedDrop: [
            [9, []],
            [1, [[1534621126189715, 1]]],
          ],
          isBlock: true,
          isAnyStone: true,
          typeOnLeaderboard: "block",
        },
      ],
      [
        BikkieIds.arrowThroughHead,
        {
          id: 4537020877770072,
          name: "arrowThroughHead",
          stackable: 1n,
          isDroppable: true,
          displayName: "Arrow Through Head",
          displayTooltip: "Arrow Through Head",
          galoisPath: "wearables/ears/arrow_through_head",
          craftingCategory: "Hats",
          tooltipTypeName: "Ears",
          wearOnEars: true,
          isWearable: true,
          typeOnLeaderboard: "wearable",
        },
      ],
      [
        BikkieIds.goldOre,
        {
          id: 4537020877770012,
          name: "goldOre",
          stackable: 99n,
          isDroppable: true,
          displayName: "Gold Ore",
          galoisPath: "blocks/gold_ore",
          craftingCategory: "Block",
          action: "place",
          tooltipTypeName: "Stone",
          seedDrop: [
            [6, []],
            [4, [[1534621126189715, 5]]],
          ],
          hardnessClass: 5,
          terrainName: "gold_ore",
          preferredDestroyerClass: 2,
          drop: [[1, [[1534621126189850, 1]]]],
          preferredDrop: [[1, [[4537020877769991, 1]]]],
          isBlock: true,
          typeOnLeaderboard: "block",
        },
      ],
      [
        BikkieIds.goldNugget,
        {
          id: 4537020877769991,
          name: "goldNugget",
          stackable: 99n,
          isDroppable: true,
          displayName: "Gold Nugget",
          displayDescription: "Smelt into bars or make small, luxurious wares.",
          galoisPath: "items/nugget_gold",
          craftingCategory: "Metals & Gems",
          tooltipTypeName: "Raw Metal",
        },
      ],
      [
        BikkieIds.workbench,
        {
          id: 1534621126189448,
          name: "workbench",
          stackable: 1n,
          isDroppable: true,
          displayName: "Workbench",
          galoisPath: "placeables/crafting_stations/log_workbench",
          craftingCategory: "Crafting Station",
          action: "place",
          tooltipTypeName: "Crafting Station",
          isCraftingStation: true,
          isPlaceable: true,
        },
      ],
      [
        BikkieIds.environmentGroup,
        {
          id: 7539420629350486,
          name: "environmentGroup",
          stackable: 1n,
          isDroppable: true,
          displayName: "Environment Group",
          craftingCategory: "Item",
          action: "place",
          meshGaloisPath: "items/cardboard_box",
          isBuild: true,
        },
      ],
      [
        BikkieIds.woodenFencer,
        {
          id: BikkieIds.woodenFencer,
          name: "woodenFencer",
          stackable: 1n,
          isDroppable: true,
          displayName: "Wooden Fencer",
          craftingCategory: "Item",
          action: "shape",
          meshGaloisPath: "items/cardboard_box",
          shape: "fence",
        },
      ],
      [
        BikkieIds.npcGlobals,
        {
          id: BikkieIds.npcGlobals,
          npcGlobals: {
            knockback: {
              popup: 0.1,
              force: 0.1,
            },
            gravity: 9.81,
            wardRange: 9,
            playerAttackInterval: 0.1,
          },
        } as any,
      ],
      [
        BikkieIds.clownfish,
        {
          id: 1534621126189355,
          name: "clownfish",
          stackable: 99n,
          isDroppable: true,
          displayName: "Clownfish",
          galoisPath: "items/fish/clownfish",
          craftingCategory: "Item",
          fishLength: 1,
          isFish: true,
          itemSellPrice: 5,
        },
      ],
      [
        BikkieIds.robotModule,
        <Biscuit>{
          id: BikkieIds.robotModule,
          name: "robotModule",
          displayName: "Robot Module",
          stackable: 1n,
          isDroppable: true,
          isRobotModule: true,
          batteryCapacity: 60 * 60 * 24 * 30,
          batteryCharge: 60 * 60 * 24 * 25,
        },
      ],
      [
        // Note: some attributes not used in tests are missing.
        BikkieIds.biomesRobot,
        <Biscuit>{
          id: BikkieIds.biomesRobot,
          name: "biomesRobot",
          stackable: 1n,
          isDroppable: true,
          isPlaceable: true,
          isQuestGiver: true,
          isChargeable: true,
          isRobot: true,
          displayName: "Biomes Bot",
          galoisPath: "npcs/helping_robot",
          craftingCategory: "Objects",
          action: "placeRobot",
          chargeTime: 3600,
          boxSize: [1, 1.5, 1],
          rotateSpeed: 200,
          walkSpeed: 20,
          runSpeed: 60,
          behavior: {
            meander: {},
          },
        },
      ],
    ])
  );
}
